# !/usr/bin/env python3
# -*- coding:utf-8 -*-
# author: 廖择贵
# createTime: 
# action:  配置文件

import os


class Config:
    """基础配置"""
    # 项目路径
    root_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

    # 测试数据路径
    excel_path = os.path.join(root_path, 'case_excel/testcase.xlsx')

    # 测试表名称
    sheet_name = 'Sheet1'

    # 测试用例路径
    test_path = os.path.join(root_path, "test_case")

    # 测试报告路径
    report_path = os.path.join(root_path, "report")
    if not os.path.exists(report_path):  # 如果文件夹不存在，就创建一个
        os.mkdir(report_path)

    # 日志文件路径
    log_path = os.path.join(root_path, "log/test.log")

    # 数据库的配置
    db_host = '8.129.21.104'
    db_port = 3309
    db_user = 'root'
    db_password = 'lzg5566'
    db_name = 'qzcsbj'

    # redis的配置
    redis_host = '8.129.21.104'
    redis_port = 6379
    redis_password = 'Redis@5566'
    redis_ex_time = 7200

    # 参数化的正则匹配
    pattern = r'\${([a-zA-Z0-9]*)}'


class DevConfig(Config):

    # 项目域名
    api_host = 'http://testapi.shinetour.com/'


config = DevConfig()

